package com.sam.im.heiqun.uis.adapters.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sam.im.heiqun.R;
import com.sam.im.heiqun.uis.adapters.GroupAdapter;

/**
 * Created by Joe on 2016/12/20.
 */

public class GroupHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    public final View mView;
    public final ImageView img;
    public final TextView name;
    private GroupAdapter.GroupListClickListener mGroupListClickListener;

    public GroupHolder(View view, GroupAdapter.GroupListClickListener messageListClickListener) {
        super(view);
        mView = view;
        this.mGroupListClickListener =messageListClickListener;
        img = (ImageView) view.findViewById(R.id.img);
        name = (TextView) view.findViewById(R.id.name);

        mView.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (mGroupListClickListener!=null)
        {
            mGroupListClickListener.onGroupListClick(v,getAdapterPosition());
        }
    }
}